﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lion.WeiXin.Core.Data
{
   public interface IOrder
    {
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        bool Exists(int AID);
        /// <summary>
        /// 增加一条数据
        /// </summary>
        int Add(Models.OrderModel model);
       /// <summary>
       /// 保存订单。成功后返回新订单ID，返回0 表示失败
       /// </summary>
       /// <param name="model"></param>
       /// <param name="products"></param>
       /// <returns></returns>
        int Add(Models.OrderModel model,List<Models.Order_DetailsModel> products);

       /// <summary>
       /// 支付订单
       /// </summary>
       /// <param name="model"></param>
       /// <returns></returns>
        int PayBill(Models.OrderModel model);
        /// <summary>
        /// 更新一条数据
        /// </summary>
        bool Update(Models.OrderModel model);
        /// <summary>
        /// 删除一条数据
        /// </summary>
        bool Delete(int AID);
        bool DeleteList(string AIDlist);
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        Models.OrderModel GetModel(int AID);
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        Models.OrderModel GetModel(string orderCode);
        /// <summary>
        /// 获得数据列表
        /// </summary>
        List<Models.OrderModel> GetList(string strWhere);
        /// <summary>
        /// 获得前几行数据
        /// </summary>
        List<Models.OrderModel> GetList(int Top, string strWhere, string filedOrder);
        int GetRecordCount(string strWhere);
        List<Models.OrderModel> GetListByPage(string strWhere, string orderby, int startIndex, int endIndex);
        /// <summary>
        /// 查询订单详细
        /// </summary>
        /// <param name="orderID"></param>
        /// <returns></returns>
        List<Models.Order_DetailsModel> GetOrderDetails(string orderID);

        /// <summary>
        /// 根据分页获得数据列表,sqlserver 2000专用
        /// </summary>
        List<Models.OrderModel> GetList(int PageSize, int PageIndex, string strWhere);
    }
}
